<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:c="http://java.sun.com/jstl/core"
	xmlns:mir="http://www.miranteinfo.com/seam/taglib"
	xmlns:mirfn="http://www.miranteinfo.com/seam/functions">

	<a4j:outputPanel ajaxRendered="true">
		<c:choose>
			<c:when test="#{globalOnly}">
				<c:set var="showWhenRendered" value="#{facesMessages != null and facesMessages.currentGlobalMessages.size() != 0}"/>
			</c:when>
			<c:otherwise>
				<c:set var="showWhenRendered" value="#{facesMessages != null and facesMessages.currentMessages.size() != 0}"/>
			</c:otherwise>
		</c:choose>
	
		<a4j:loadStyle src="resource://com/miranteinfo/seam/facelets/css/mirante-seam.css"/>
	
		<rich:modalPanel moveable="false" resizeable="false"
			showWhenRendered="#{showWhenRendered}"
			id="messageModalPanel" height="100" autosized="true" zindex="900" minWidth="550" onshow="document.getElementById('miranteSeamFormMsg:#{not empty buttonId ? buttonId : 'mirMessageButtonId'}').focus();">
			<h:form id="miranteSeamFormMsg">
				<rich:panel style="text-align: left; width: 100%;" >
					<rich:messages 	globalOnly="#{mirfn:getDefaultValue(globalOnly, false)}"
									errorClass="#{errorClass}"
									errorLabelClass="#{errorLabelClass}"
									errorMarkerClass="#{errorMarkerClass}"
									fatalClass="#{fatalClass}"
									fatalLabelClass="#{fatalLabelClass}"
									fatalMarkerClass="#{fatalMarkerClass}"
									infoClass="#{infoClass}"
									infoLabelClass="#{infoLabelClass}"
									infoMarkerClass="#{infoMarkerClass}"
									warnClass="#{warnClass}"
									warnLabelClass="#{warnLabelClass}"
									warnMarkerClass="#{warnMarkerClass}"
									style="#{style}"
									styleClass="#{styleClass}"/>
									
					<br/>
					<div style="text-align: center;">
						<a4j:commandButton 	id="#{not empty buttonId ? buttonId : 'mirMessageButtonId'}"
											value="#{not empty buttonValue ? buttonValue : 'OK'}" 
											title="#{buttonTitle}" 
											onclick="Richfaces.hideModalPanel('messageModalPanel');" 
											style="#{buttonStyle}"
											styleClass="#{buttonStyleClass}"/>
					</div>
				</rich:panel>
			</h:form>
		</rich:modalPanel>
	</a4j:outputPanel>

</ui:composition>
